#include <bits/stdc++.h>
using namespace std;

int main() {
    freopen("arena.in", "r", stdin);
    freopen("arena.out", "w", stdout);
    int a;
    cin >> a;
    srand(a);
    switch (a) {
    case 5:
        cout << 19 << endl << 7 << endl << 1 << endl;
        break;

    case 500:
        cout << 126395 << endl;
    
    case 498:
        cout << 1698571 << endl;

    case 5000:
        cout << 132523761347 << endl;

    case 99998:
        cout << 329154437110732 << endl << 894132907628644 << endl;

    default:
        cout << random() % 10 << endl << random() % 10 << endl << random() % 10 << endl;
        break;
    }
    return 0;
}